<template>
    <div class="viewDialog">
        <el-dialog :close-on-click-modal="true" :close-on-press-escape="true" v-model="visible" title=""
            top="5vh" :show-close="false" class="dialogAdd" :before-close="handleClose">
            <div class="dialog_content">
                <div class="dialog_header">
                    <div class="title">
                        <img src="../../../../assets/images/rectangle07.png" alt="">
                        <span>查看工单</span>
                    </div>
                </div>
                <div class="dialog_details">

                    <div class="navBar">
                        <ul>
                            <li :class="activeIndex == 0 ? 'active' : ''" @click="changeNav(0)">
                                <span>基本信息</span>
                            </li>
                            <li class="userType" :class="activeIndex == 1 ? 'active' : ''" @click="changeNav(1)">
                                <span>进度信息</span>
                            </li>
                        </ul>
                    </div>
                    <!-- 基本信息 -->
                    <details_basicInfo v-if="activeIndex == 0"></details_basicInfo>
                    <!-- 进度信息 -->
                    <details_progress  v-if="activeIndex == 1"></details_progress>
                </div>
            </div>

        </el-dialog>
    </div>
</template>

<script setup lang="ts">
import details_basicInfo from "./details_basicInfo.vue";
import details_progress from "./details_progress.vue";
const props = defineProps({
    dialogVisible: {
        type: Boolean,
        default: false
    }
})
let visible = ref(false);

let activeIndex = ref(0);

//切换tab栏
const changeNav = (val: number) => {
    if (activeIndex.value != val) {
        activeIndex.value = val;
    }

}


watch(() => props.dialogVisible, (newValue, oldValue) => {
    visible.value = newValue;
});

//emit(父组件中的自定义方法)
const emit = defineEmits(['closeDialog', 'updateList']);

//关闭弹窗
const handleClose = () => {
    emit("closeDialog");
}


</script>

<style scoped lang="scss">
.viewDialog {
    :deep(.dialogAdd) {
        width: 1190px;
        min-height: 778px;
        background: rgba(255, 255, 255, 1);
        border-radius: 2px;
        box-shadow: 0px 6px 16px -8px rgba(0, 0, 0, 0.08), 0px 9px 28px 0px rgba(0, 0, 0, 0.05), 0px 12px 48px 16px rgba(0, 0, 0, 0.03);

        .el-dialog__header {
            padding: 0;

        }

        .el-dialog__body {
            padding: 0;

            .dialog_content {
                .dialog_header {
                    padding: 0;
                    height: 59px;
                    padding: 8px 32px 4px 62px;
                    line-height: 52px;
                    font-size: 16px;
                    font-weight: 400;
                    color: rgba(0, 0, 0, 1);
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    border-bottom: 1px dashed rgba(112, 105, 95, 1);

                    .title {
                        display: flex;
                        align-items: center;

                        img {
                            width: 4px;
                            height: 22px;
                            margin-right: 15px;
                        }

                    }

                    .close {
                        width: 25px;
                        height: 25px;
                        cursor: pointer;

                    }
                }

                .dialog_details {
                    padding: 25px 67px 30px 48px;
                    font-size: 16px;
                    font-weight: 400;
                    letter-spacing: 0px;
                    line-height: 30px;
                    color: rgba(0, 0, 0, 1);

                    .navBar {
                        ul {
                            // width: 320px;
                            display: flex;
                            // border: 1px solid rgb(229, 229, 229);

                            li {
                                width: 160px;
                                height: 38px;
                                font-size: 16px;
                                font-weight: 400;
                                letter-spacing: 0px;
                                line-height: 36px;
                                // color: rgba(0, 0, 0, 1);
                                color: rgb(112, 105, 95);
                                text-align: center;
                                cursor: pointer;
                                position: relative;
                                border-top: 1px solid rgb(229, 229, 229);
                                border-bottom: 1px solid rgb(229, 229, 229);
                                border-right: 1px solid rgb(229, 229, 229);

                                &:first-child {
                                    border-left: 1px solid rgb(229, 229, 229);
                                }

                                &.active {
                                    width: 160px;
                                    font-size: 16px;
                                    line-height: 36px;
                                    color: rgba(0, 0, 0, 1);
                                    background: rgb(229, 229, 229);
                                }
                            }

                        }
                    }



                }

            }
        }


    }

}
</style>
